package com.team.RunsFast_Api.controller;

import com.team.RunsFast_Api.dto.FoodAddDto;
import com.team.RunsFast_Api.dto.PositionDto;
import com.team.RunsFast_Api.service.impl.FoodServiceImpl;
import com.team.RunsFast_Api.service.intf.FoodService;
import com.team.RunsFast_Api.service.intf.StoreService;
import com.team.RunsFast_Api.service.intf.UserService;
import com.team.runsfast.entity.Store;
import com.team.runsfast.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author fxy
 * @date 2022/9/24
 */
@RestController
@RequestMapping("/api/food/")
@Api(tags = "美食操作")
@CrossOrigin
public class FoodController {

    @Autowired
    private FoodServiceImpl service;


    /**新增*/
    @PostMapping("addfood.do")
    public R addFood(@RequestBody FoodAddDto foodAddDto){
        return service.addFood(foodAddDto);
    }

    /**查询菜品*/
    @ApiOperation(value = "查询指定店铺所有菜品")
    @GetMapping("selectfood.do")
    public R selectFood(Long sid){
        return service.selectBySid(sid);
    }

}
